<script lang="ts" setup>
import { getMedicalOrderDetail } from '@/apis/order';
import type { MedicalOrderDetail } from '@/types/order';
import { ref ,onMounted} from 'vue';
import { useMedic } from '@/hooks/index'
// 获取地址的参数
const props = defineProps<{ orderId: string }>()
const { orderDetail } =  useMedic(props.orderId)
</script>
<template>
  <view class="pay-result-page">

    <view class="result" v-if="orderDetail?.status === 10 || orderDetail?.status ===14">
      <uni-icons size="70" color="#20c6b2" type="closeempty" />
      <view class="amount">¥ {{ orderDetail.actualPayment }}</view>
      <view class="label">支付失败</view>
      <view class="tips">订单支付失败，请回订单中心重新支付~</view>
    </view>

    <view class="result" v-else>
      <uni-icons size="70" color="#20c6b2" type="checkbox-filled" />
      <view class="amount">¥ {{ orderDetail.actualPayment }}</view>
      <view class="label">支付成功</view>
      <view class="tips">订单支付成功，已通知药房尽快发出，请耐心等待~</view>
    </view>

    <view class="buttons">
      <navigator hover-class="none" :url="`/subpkg_medicine/order_detail/index?id=${orderDetail.id}`" class="uni-button">
        查看订单
      </navigator>
      <navigator hover-class="none" :url="`/subpkg_consult/room/index?orderId=${orderDetail.roomId}`" open-type="redirect" class="uni-button plain">
        返回诊室
      </navigator>
    </view>
  </view>
</template>

<style lang="scss">
@import './index.scss';
</style>